package mx.com.mindbits.dao;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import mx.com.mindbits.dao.transactions;
import mx.com.mindbits.dao.users;
import mx.com.mindbits.dao.contacts;

import mx.com.mindbits.dao.transactionsDao;
import mx.com.mindbits.dao.usersDao;
import mx.com.mindbits.dao.contactsDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig transactionsDaoConfig;
    private final DaoConfig usersDaoConfig;
    private final DaoConfig contactsDaoConfig;

    private final transactionsDao transactionsDao;
    private final usersDao usersDao;
    private final contactsDao contactsDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        transactionsDaoConfig = daoConfigMap.get(transactionsDao.class).clone();
        transactionsDaoConfig.initIdentityScope(type);

        usersDaoConfig = daoConfigMap.get(usersDao.class).clone();
        usersDaoConfig.initIdentityScope(type);

        contactsDaoConfig = daoConfigMap.get(contactsDao.class).clone();
        contactsDaoConfig.initIdentityScope(type);

        transactionsDao = new transactionsDao(transactionsDaoConfig, this);
        usersDao = new usersDao(usersDaoConfig, this);
        contactsDao = new contactsDao(contactsDaoConfig, this);

        registerDao(transactions.class, transactionsDao);
        registerDao(users.class, usersDao);
        registerDao(contacts.class, contactsDao);
    }
    
    public void clear() {
        transactionsDaoConfig.getIdentityScope().clear();
        usersDaoConfig.getIdentityScope().clear();
        contactsDaoConfig.getIdentityScope().clear();
    }

    public transactionsDao getTransactionsDao() {
        return transactionsDao;
    }

    public usersDao getUsersDao() {
        return usersDao;
    }

    public contactsDao getContactsDao() {
        return contactsDao;
    }

}
